package com.letoken.platform.repo.admin.req.blockchain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * @author wyl
 * @date 2023/4/18 11:52
 * @Version 1.0
 */
@Data
@ApiModel(value = "添加公链请求对象", description = "添加公链请求对象")
public class AddBlockchainReq {

    @NotBlank(message = "公链名称不能为空")
    @ApiModelProperty(value = "菜单名称", example = "Ethereum")
    private String name;

    @NotBlank(message = "LOGO不能为空")
    @Pattern(regexp = "^http(s)?://([\\w-]+\\.)+[\\w-]+(/[\\w-./?%&=]*)?$", message = "LOGO为空或格式错误！")
    @ApiModelProperty(value = "LOGO")
    private String iconUrl;

    @NotBlank(message = "RPC地址不能为空")
    @Pattern(regexp = "^http(s)?://([\\w-]+\\.)+[\\w-]+(/[\\w-./?%&=]*)?$", message = "PRC地址为空或格式错误！")
    @ApiModelProperty(value = "RPC地址", example = "https://eth.llamarpc.com")
    private String rpcUrl;

    @NotBlank(message = "链ID不能为空")
    @ApiModelProperty(value = "链ID", example = "1")
    private String networkId;

    @NotBlank(message = "代币符号不能为空")
    @ApiModelProperty(value = "代币符号", example = "ETH")
    private String tokenSymbol;

    @Pattern(regexp = "^http(s)?://([\\w-]+\\.)+[\\w-]+(/[\\w-./?%&=]*)?$", message = "区块链浏览器为空或格式错误！")
    @NotBlank(message = "区块链浏览器不能为空")
    @ApiModelProperty(value = "区块链浏览器", example = "https://etherscan.io")
    private String blockchainBrowser;

    @ApiModelProperty(value = "排序", example = "1")
    private Integer sort;
}
